// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) 

package com.yoyo.lib.utilities;

import android.text.Layout;
import android.view.ViewTreeObserver;
import android.widget.EditText;
import android.widget.TextView;
import java.util.Collection;
import java.util.Map;

public class TextUtil
{

    public TextUtil()
    {
    }

    public static String getText(EditText edittext)
    {
        return edittext.getText().toString();
    }

    public static transient boolean isNotNull(EditText aedittext[])
    {
        int i = 0;
_L3:
        if(i >= aedittext.length)
            break MISSING_BLOCK_LABEL_47;
        if(aedittext[i].getText() != null && !"".equals(aedittext[i].getText().toString().trim())) goto _L2; else goto _L1
_L1:
        boolean flag = false;
_L4:
        return flag;
_L2:
        i++;
          goto _L3
        flag = true;
          goto _L4
    }

    public static transient boolean isTextEquals(EditText aedittext[])
    {
        boolean flag = true;
        if(aedittext.length <= flag) goto _L2; else goto _L1
_L1:
        int i = 0;
_L7:
        if(i >= -1 + aedittext.length) goto _L2; else goto _L3
_L3:
        if(aedittext[i].getText().toString().trim().equals(aedittext[i + 1].getText().toString().trim())) goto _L5; else goto _L4
_L4:
        flag = false;
_L2:
        return flag;
_L5:
        i++;
        if(true) goto _L7; else goto _L6
_L6:
    }

    public static boolean isValidate(String s)
    {
        boolean flag;
        if(s != null && !"".equals(s.trim()))
            flag = true;
        else
            flag = false;
        return flag;
    }

    public static boolean isValidate(Collection collection)
    {
        boolean flag;
        if(collection != null && collection.size() > 0)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public static boolean isValidate(Map map)
    {
        boolean flag;
        if(map != null && map.size() > 0)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public static void truncate(final TextView view, final int maxLine)
    {
        view.getViewTreeObserver().addOnGlobalLayoutListener(new android.view.ViewTreeObserver.OnGlobalLayoutListener() {

            public void onGlobalLayout()
            {
                if(view.getLineCount() > maxLine)
                {
                    int i = view.getLayout().getLineEnd(-1 + maxLine);
                    String s = (new StringBuilder()).append(view.getText().subSequence(0, i - 3)).append("...").toString();
                    view.setText(s);
                }
            }

            final int val$maxLine;
            final TextView val$view;

            
            {
                view = textview;
                maxLine = i;
                Object();
            }
        });
    }
}
